#ifndef CPLAYER_H
#define CPLAYER_H

#include "CEntity.h"
#include "CWeapon.h"
#include "CHealerWeapon.h"
#include "CEnemy.h"
#include "CSpecialItem.h"
#include <list>
using namespace std;

class CPlayer : public CEntity
{
public:
	CPlayer();
	virtual ~CPlayer();

	virtual void Render();
	virtual void Update();
	virtual void Load();
	virtual void TakeDamage(float damage = 1);
	virtual void Kill(); 
	void FireBullet();

	void EquipPrimary( CWeapon* weapon );
	void SetRateOfFire( float rate );
	
	void PerformAction( float& action, float change, float time );
	void Jump();
	void JumpUpdate();
	void ResetJump();
	void StopJump();
	void Respawn();
	void AttachItem( CSpecialItem* itemtoadd );
	void UpdateAttachedItems();
	void RemoveItem( CSpecialItem* itemtoremove );
	void RemoveAllItems();

	void SetJumping( bool isItJumping )			{ m_bIsJumping = isItJumping; }
	void SetJumpRate( float jumprate )			{ m_fJumpRate = jumprate; }
	void SetJumpTimer( float jumptimer )		{ m_fJumpTimer = jumptimer; }
	void SetJumpTime( float jumptime )			{ m_fJumpTime = jumptime; }
	void SetCanShoot( bool canplayershoot )		{ m_bCanShoot = canplayershoot; }

	bool GetJumping()							{ return m_bIsJumping; }
	float GetJumpRate()							{ return m_fJumpRate; }
	float GetJumpTimer()						{ return m_fJumpTimer; }
	float GetJumpTime()							{ return m_fJumpTime; }
	bool  GetCanShoot()							{ return m_bCanShoot; }

	bool	m_bIsJumping;
	float	m_fJumpRate;
	float	m_fJumpTimer;
	float   m_fJumpTime;
	bool	m_bCanShoot;

	CWeapon* PrimaryWeapon;
	CHealerWeapon* SecondaryWeapon;
	list< CAction* > Commands;
	list< CSpecialItem* > Items;

	int FriendLevel;
	float BaseSpeed;
	float JumpForce; //if not updating commands, i.e. they're empty, set to 30, otherwise low with ghosts, high with friends
	float AirTime;

	//bool*  KeyState;  the player should have access to the games keys
//	CEntity*** Bullets;	//2d array of bullet pointers. first array is bullets, second is spread
//	int NumBullets;		//number of bullets in the array
//	float RateOfFire;	//rate of fire for the weapon
//	float FireTimer;	//firingtimer
//	int Spread;			//number of bullets in the spread
//	float SpreadAngle;	//angle difference for each bullet
};


#endif